package Coding.file;

import java.io.File;

//获取目录中的子项
public class ListFiles {
    public static void main(String[] args) {
            //
        File dir = new File(".");
        //获取  是file对象
        File[] subs = dir.listFiles();
        //快速生产 利用下标遍历该对象的for循环
        for (int i = 0; i < subs.length; i++) {
            System.out.println(subs[i]);
            System.out.println(subs[i].getName());
            System.out.println(subs[i].getAbsolutePath());
        }


    }

}
